unit main;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls,StdCtrls, IdBaseComponent, IdComponent, IdIOHandler,
  IdIOHandlerSocket, IdIOHandlerStack, IdSSL, IdSSLOpenSSL,shdocvw, OleCtrls,backend,
  ComCtrls;

type
  TForm1 = class(TForm)
    Image1: TImage;
    Button1: TButton;
    Memo1: TMemo;
    procedure Button1Click(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
    procedure SetComCtrlStyle(WinCtrl: TWinControl; Value: Integer; UseStyle: Boolean);
 const TVS_CHECKBOXES = $00000100;
var
  Form1: TForm1;
      var   waitforLogin:LoginThread;
implementation
      uses Jpeg,webapp,strutils,superobject,dateUtils;
{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);

begin
       waitforLogin:=LoginThread.create(true);
       waitforLogin.start;
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
     if waitforLogin <> nil then
     begin
       waitforLogin.Terminate  ;
       waitforLogin:=nil;
     end;

end;
  procedure TForm1.FormCreate(Sender: TObject);
begin
//SetComCtrlStyle(TreeView1, TVS_CHECKBOXES, True);

end;

procedure SetComCtrlStyle(WinCtrl: TWinControl; Value: Integer; UseStyle: Boolean);
var
Style: Integer;
begin
   if WinCtrl.HandleAllocated then
   begin
     Style := GetWindowLong(WinCtrl.Handle, GWL_STYLE);
     if not UseStyle then
     Style := Style and not Value
     else Style := Style or Value;
     SetWindowLong(WinCtrl.Handle, GWL_STYLE, Style);
   end;
end;
end.
